class Parent {
  constructor(name) {
    this.name = name
  }

  showName() {
    console.log(this.name)
  }
}

class Child extends Parent {
  constructor(name) {
    // 调用父类的构造方法
    super(name)
  }

  showName() {
    console.log('Child')
    // 调用父类的方法
    super.showName()
  }
}

const child = new Child('张智琦')
child.showName()
